﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master.master" AutoEventWireup="true" CodeFile="PermissionsManager.aspx.cs" Inherits="PermissionsManager" %>

<%@ Register Assembly="DevExpress.Web.v10.2.Linq, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Data.Linq" TagPrefix="dx" %>

<%@ Register Assembly="DevExpress.Web.ASPxTreeList.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTreeList" TagPrefix="dx" %>

<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallbackPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" runat="server" contentplaceholderid="MainContent">
    <h1 class="DemoTitle">
        人员权限分配管理
    </h1>
    <div id="DemoArea">
        <div class="Spacer" style="height: 14px;">
        </div>
           <table runat="server" id="QueryTable">
            <tr>
                <td>
                    <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="人员">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxComboBox ID="ASPxCmbData" runat="server" ValueType="System.String" 
                        ValueField="ID" ClientInstanceName="c_user" 
                        DataSourceID="cmdDataSource" 
                        CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                        CssPostfix="Office2010Blue" Spacing="0" 
                        SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
                        Font-Size="9pt" DisplayFormatString="{0}" >
                        <Columns>
                            <dx:ListBoxColumn Caption="用户名" FieldName="UserName" />
                            <dx:ListBoxColumn Caption="登录名" FieldName="LoginName" />
                            <dx:ListBoxColumn Caption="是否为超级管理员" FieldName="IsAdmin" />
                        </Columns>
                     <%--   <ClientSideEvents TextChanged="function(s, e) {QueryTree.PerformCallBack(s.GetValue());}" />--%>
                         <ClientSideEvents TextChanged="function(s,e){QueryTree.PerformCallback(s.GetValue()); }" />
                        <ItemStyle Font-Size="9pt" />
                        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                        </LoadingPanelImage>
                        <LoadingPanelStyle ImageSpacing="5px">
                        </LoadingPanelStyle>
                        <ButtonStyle Width="13px">
                        </ButtonStyle>
                    </dx:ASPxComboBox>
                </td>
                <td style="padding-left: 5px">
                    <dx:ASPxButton ID="btnSave" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                        CssPostfix="Office2010Blue" Font-Size="10pt" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                        Text="保存" AutoPostBack="False" UseSubmitBehavior="False" >
                       <%-- PerformCallback就是从客户端到服务端的桥梁，它是单向的只能从客户端发起到服务端。--%>
                        <ClientSideEvents Click="function(s,e){QueryPanel.PerformCallback(c_user.GetValue()); }" />
                    </dx:ASPxButton>
                </td>
            </tr>
            </table>

                <dx:ASPxCallbackPanel ID="QueryCBPanel" runat="server" Width="100%" 
            oncallback="QueryCBPanel_Callback" ClientInstanceName="QueryPanel">
                    <PanelCollection>
                        <dx:PanelContent runat="server" SupportsDisabledAttribute="True">
                          
                            
                          
                            <dx:ASPxTreeList ID="DxTreelist" runat="server" AutoGenerateColumns="False" 
                                Width="100%" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                CssPostfix="Office2010Blue" OnCustomCallback="DxTreelist_CustomCallback" 
                                ClientInstanceName="QueryTree" Font-Size="10pt" KeyFieldName="FunctionID" 
                                ParentFieldName="ParentID">
                              <%--  在客户端进行Dev控件编程必须为Dev控件指定一个客户端的名称即ClientInstanceName客户端直接根据ClientInstanceName来进行相关的操作--%>
                                <Columns>
                                    <dx:TreeListTextColumn Caption="编号" FieldName="FunctionID" VisibleIndex="0">
                                    </dx:TreeListTextColumn>
                                    <dx:TreeListTextColumn Caption="功能" FieldName="Description" VisibleIndex="1">
                                    </dx:TreeListTextColumn>
                                </Columns>
                                <Settings SuppressOuterGridLines="True" />
                                <SettingsBehavior AllowFocusedNode="True" AutoExpandAllNodes="true" />
                                <SettingsPager>
                                    <Summary Text="当前第{0}页，共{1}页，{2}条记录" />
                                </SettingsPager>
                                <SettingsSelection Enabled="True" Recursive="True" />
                                <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                    <LoadingPanel Url="~/App_Themes/Office2010Blue/TreeList/Loading.gif">
                                    </LoadingPanel>
                                </Images>
                                <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                    CssPostfix="Office2010Blue">
                                    <LoadingPanel ImageSpacing="5px">
                                    </LoadingPanel>
                                </Styles>
                                <StylesPager>
                                    <PageNumber ForeColor="#3E4846">
                                    </PageNumber>
                                    <Summary ForeColor="#1E395B">
                                    </Summary>
                                </StylesPager>
                                <StylesEditors ButtonEditCellSpacing="0">
                                </StylesEditors>
                            </dx:ASPxTreeList> 
                        </dx:PanelContent>
                    </PanelCollection>
                </dx:ASPxCallbackPanel>



    <asp:SqlDataSource ID="cmdDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CMSConnectionString %>" 
        
            SelectCommand="SELECT [ID], [LoginName], [Rights], [IsAdmin], [UserName] FROM [Users]">
    </asp:SqlDataSource>


        <%--<dx:LinqServerModeDataSource ID="cmdDataSource2" runat="server" 
            ContextTypeName="DAL.DataClassesDataContext" TableName="Users" 
            onselecting="cmdDataSource2_Selecting" />--%>

    </div>

</asp:Content>


